package cae.logic.history;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import cae.logic.CaeMessage;


public class CaeMessageHistory 
{
	private static CaeMessageHistory instance;
	private List<CaeMessage> messages;
	
	private CaeMessageHistory()
	{
		messages = new ArrayList<CaeMessage>();
	}
	
	public static CaeMessageHistory getInstance()
	{
		if(instance == null)
			instance = new CaeMessageHistory();
		return instance;
	}
	
	public void addMessage(CaeMessage message)
	{
		message.setDate(new Date());
		messages.add(message);
	}

	public List<CaeMessage> getMessages() {
		return messages;
	}
}
